import request from '@/utils/request'

// 查询表明细信息列表
export function listDetail(query) {
  return request({
    url: '/reportworld/detail/list',
    method: 'get',
    params: query
  })
}

// 查询表明细信息详细
export function getDetail(data) {
  return request({
    url: '/reportworld/detail/getTableDetailInfo',
    method: 'post',
    data: data
  })
}

// 新增表明细信息
export function addDetail(data) {
  return request({
    url: '/reportworld/detail',
    method: 'post',
    data: data
  })
}

// 修改表明细信息
export function updateDetail(data) {
  return request({
    url: '/reportworld/detail',
    method: 'put',
    data: data
  })
}

// 删除表明细信息
export function delDetail(idList, hisVersion) {
  const data = {
    idList,
    hisVersion
  };
  return request({
    url: '/reportworld/detail/remove',
    method: 'post',
    data: data
  })
}

// 初始化查询
export function init(data) {
  return request({
    url: '/reportworld/detail/init',
    method: 'post',
    data: data
  })
}

// 初始化查询
export function initDeatil(data) {
  return request({
    url: '/reportworld/detail/initDeatil',
    method: 'post',
    data: data
  })
}

/**
 * 保存顺序
 * @param data
 */
export function handleUpdateOrderNum(data) {
  return request({
    url: '/reportworld/detail/handleUpdateOrderNum',
    method: 'post',
    data: data
  })
}

// 获取添加修改需要的数据
export function getInfo(data) {
  return request({
    url: '/reportworld/detail/getInfo',
    method: 'post',
    data: data
  })
}

// 获取所有表信息
export function getInfoDetail(data) {
  return request({
    url: '/reportworld/detail/getInfoDetail',
    method: 'post',
    data: data
  })
}

// 批量修改字段信息
export function handleUpdateBatch(data) {
  return request({
    url: '/reportworld/detail/handleUpdateBatch',
    method: 'post',
    data: data
  })
}
